var dsq,
    dsq1,
    a = getApp();

Page({
    data: {
        second: 0
    },
    onLoad: function(e) {
        var o = this;
        var n = decodeURIComponent(e.scene);
        if ("undefined" != n) var t = n;
        if (null != e.userid) {
            t = e.userid;
        }
        this.setData({
                // fxzuid: t
            }),
            a.getUserInfo(function(e) {
                null != t ? a.util.request({
                        url: "entry/wxapp/Binding",
                        cachetime: "0",
                        data: {
                            fx_user: e.id,
                            user_id: t
                        },
                        success: function(e) {}
                    }) :
                    a.util.request({
                        url: "entry/wxapp/Binding",
                        cachetime: "0",
                        data: {
                            fx_user: e.id,
                            user_id: 0
                        },
                        success: function(e) {}
                    });
            }),
            a.setNavigationBarColor(this),
            a.util.request({
                url: "entry/wxapp/system",
                cachetime: "0",
                success: function(e) {
                    var n = Number(e.data.countdown);
                    dsq = setInterval(function() {
                        n--, o.setData({
                            second: n
                        });
                    }, 1e3);
                    dsq1 = setTimeout(function() {
                        clearInterval(dsq), o.tggg();
                    }, 1e3 * n);
                    var t = e.data;
                    o.setData({
                        xtxx: t,
                        second: e.data.countdown
                    }), getApp().xtxx1 = t, wx.setNavigationBarTitle({
                        title: e.data.url_name
                    });
                }
            });
    },
    tggg: function() {
        clearInterval(dsq);
        clearTimeout(dsq1);
        var e = this.data.xtxx;
        "1" == e.model && wx.reLaunch({
            url: "/zh_cjdianc/pages/index/index"
        });
        "2" == e.model && (getApp().sjid = e.default_store, wx.reLaunch({
            url: "/zh_cjdianc/pages/seller/index"
        }));
        "4" == e.model && (getApp().sjid = e.default_store, wx.reLaunch({
            url: "/zh_cjdianc/pages/seller/indextakeout"
        }));
    },
});